<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>login</title>
</head>
<style>
    * {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    body {
        background-image: url('../resources/login.jpg');
        background-size: cover;
        background-position: center;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        height: 100vh;
        margin: 0;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    .login-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 390px;
        padding: 40px;
        background-color: rgba(0, 0, 0, 0.2);
        box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4);
        margin-right: 200px;
        text-align: center;
        border-radius: 10px;
    }

    .login-title {
        text-align: center;
        font-weight: bold;
        font-size: 2em;
        position: relative;
        color: #fff;
        margin-bottom: 15px;
    }

    .login-title::after {
        content: "";
        display: block;
        width: 100%;
        height: 2px;
        background-color: #03e9f4;
        position: absolute;
        bottom: 0;
        left: 0;
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    .login-title:hover::after {
        transform: scaleX(1);
    }

    input:-webkit-autofill {
        -webkit-box-shadow: 0 0 0px 32px #fff inset; /**通过边框阴影遮挡住背景*/
        -webkit-text-fill-color: #333; /*自动填充内容的文本颜色*/
    }
    .form-group {
        position: relative;
        margin-bottom: 10px; /* Reduced margin-bottom to decrease space between inputs */
        width: 100%;
        margin-top: 30px; /* Added margin-top to move it down */
    }

    .form-input {
        outline: none;
        border: none;
        width: 100%;
        padding: 12px 0;
        margin-bottom: 10px; /* Reduced margin-bottom to decrease space between inputs */
        color: #fff;
        font-size: 16px;
        border-bottom: 1px solid #fff;
        background-color: transparent;
    }

    .form-label {
        position: absolute;
        top: 0;
        left: 0;
        padding: 12px 0;
        color: #777;
        pointer-events: none;
        transition: all 0.3s;
        font-size: 16px;
    }

    .form-input:focus + .form-label,
    .form-input:not(:placeholder-shown) + .form-label {
        top: -20px;
        left: 0;
        color: #03e9f4;
        font-size: 14px;
    }

    .form-checkbox {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
        font-size: 14px;
        color: #fff;
    }

    .checkbox-input {
        margin-right: 5px;
    }

    .forgot-password-link {
        color: #03e9f4;
        text-decoration: none;
    }

    .forgot-password-link:hover {
        text-decoration: underline;
    }

    .login-button {
        width: 100%;
        padding: 12px;
        border: none;
        border-radius: 5px;
        background: #03e9f4;
        color: white;
        font-size: 18px;
        cursor: pointer;
        transition: background 0.3s;
    }

    .login-button:hover {
        background: #0056b3;
    }

    .signup-link {
        margin-top: 20px;
        font-size: 14px;
        color: #fff;
    }

    .signup-link a {
        color: #03e9f4;
        text-decoration: none;
    }

    .signup-link a:hover {
        text-decoration: underline;
    }
</style>
<body>
<div class="login-container">
    <h2 class="login-title">新 闻 发 布 系 统</h2>
    <form method="POST" action="../loginServlet" class="login-form">
        <div class="form-group">
            <input type="text" id="username" name="username" class="form-input" placeholder=" " required>
            <label for="username" class="form-label">Username</label>
        </div>
        <div class="form-group">
            <input type="password" id="password" name="password" class="form-input" placeholder=" " required>
            <label for="password" class="form-label">Password</label>
        </div>
        <div class="form-checkbox">
            <label>
                <input type="checkbox" class="checkbox-input">
                <span class="checkbox-label">记住我</span>
            </label>
            <a href="#" class="forgot-password-link">忘记密码</a>
        </div>
        <button type="submit" class="login-button">登   录</button>
    </form>
    <div class="signup-link">
        没有账户? <a href="register.jsp">登记</a>
    </div>
</div>
</body>
</html>